/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;
import java.io.Serializable;
import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.EmbeddedId;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.UniqueConstraint;
/**
 *
 * @author Elias Mendoza
 */
@Entity
@Table(name="producto_sustrato")
@AssociationOverrides({
		@AssociationOverride(name = "primaryKey.sustratoFK", 
			joinColumns = @JoinColumn(name = "sustrato_id",referencedColumnName="id")),
		@AssociationOverride(name = "primaryKey.productoFK", 
			joinColumns = @JoinColumn(name = "nave_id",referencedColumnName="id")) })
public class ProductoSustrato implements Serializable{
  @EmbeddedId
  private ProductoSustratoPK primaryKey;
  @Column(name="fila_surco")
  private int filaSurco;
  @Column(name="coor_a_x")
  private float coordenadaAX;
  @Column(name="coor_a_y")
  private float coordenadaAY;
  @Column(name="coor_b_x")
  private float coordenadaBX;
  @Column(name="coor_b_y")
  private float coordenadaBY;
  
 

  public ProductoSustrato() {
  }

  public ProductoSustrato(ProductoSustratoPK primaryKey, int filaSurco, float coordenadaAX, float coordenadaAY, float coordenadaBX, float coordenadaBY) {
    this.primaryKey = primaryKey;
    this.filaSurco = filaSurco;
    this.coordenadaAX = coordenadaAX;
    this.coordenadaAY = coordenadaAY;
    this.coordenadaBX = coordenadaBX;
    this.coordenadaBY = coordenadaBY;
  }

  public ProductoSustratoPK getPrimaryKey() {
    return primaryKey;
  }

  public void setPrimaryKey(ProductoSustratoPK primaryKey) {
    this.primaryKey = primaryKey;
  }

  public float getCoordenadaAX() {
    return coordenadaAX;
  }

  public void setCoordenadaAX(float coordenadaAX) {
    this.coordenadaAX = coordenadaAX;
  }

  public float getCoordenadaAY() {
    return coordenadaAY;
  }

  public void setCoordenadaAY(float coordenadaAY) {
    this.coordenadaAY = coordenadaAY;
  }

  public float getCoordenadaBX() {
    return coordenadaBX;
  }

  public void setCoordenadaBX(float coordenadaBX) {
    this.coordenadaBX = coordenadaBX;
  }

  public float getCoordenadaBY() {
    return coordenadaBY;
  }

  public void setCoordenadaBY(float coordenadaBY) {
    this.coordenadaBY = coordenadaBY;
  }

  public int getFilaSurco() {
    return filaSurco;
  }

  public void setFilaSurco(int filaSurco) {
    this.filaSurco = filaSurco;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    final ProductoSustrato other = (ProductoSustrato) obj;
    if (this.primaryKey != other.primaryKey && (this.primaryKey == null || !this.primaryKey.equals(other.primaryKey))) {
      return false;
    }
    return true;
  }

  @Override
  public int hashCode() {
    int hash = 5;
    hash = 29 * hash + (this.primaryKey != null ? this.primaryKey.hashCode() : 0);
    return hash;
  }

 
  
}
